]> dgit.raspbian.org Git - gnome-shell.git/commit
st/theme-node: Forget properties cache on stylesheet change
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Thu, 28 Mar 2024 06:45:26 +0000 (14:45 +0800)
committerJeremy Bícha <jbicha@ubuntu.com>
Thu, 16 Jan 2025 22:40:28 +0000 (17:40 -0500)
commit98495ad046d133c388cdb2f97f640fbe26e64957
tree1ddc61b6e5334038316d84c444566d5133094c1a
parent715e76b8aa0f30d79370fbefa26071e0b4690a94
st/theme-node: Forget properties cache on stylesheet change

To avoid `node->properties` pointing to freed memory after each
`st_theme_unload_stylesheet`, flush the cache that is `node->properties`.
They will be reloaded as soon as they are required by `ensure_properties`.

And yes `node->stylesheets_changed_id` already existed, but was unused.

Why not just fix Croco? Croco does not use proper reference counting
everywhere it should, and retrofitting it would be difficult due to the
recursive nature of `CRDeclaration`.

Includes commit:
st/theme-node: Forget properties cache before unref'ing the theme
Which the properties point into.

Origin: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3252
Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7339
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2069559
Bug-Dash-to-Dock: https://github.com/micheleg/dash-to-dock/issues/2179

Gbp-Pq: Name st-theme-node-Forget-properties-cache-on-stylesheet-chang.patch
src/st/st-theme-node-private.h
src/st/st-theme-node.c